function capacity=capacity(h,nr,nt,rho)

Inr=diag(ones(nr,1));
if(nt < nr)
	In=diag(ones(nr,1));
	capacity=log( det( In + 1/nt*rho*h*h' ) );
else
	In=diag(ones(nt,1));
	capacity=log( det( In + 1/nt*rho*h'*h ) );
end
